#ifndef DIALOG_TYPELIST_H
#define DIALOG_TYPELIST_H

#include "EController.h"
#include "qtreewidget.h"
#include <DefineLibUiQt.h>
#include <QString>
#include <QtWidgets/QWidget>
#include <QtWidgets/QDialog>
#include <QtWidgets/QTreeWidgetItem>
#include <EControllerQtTree.h>

namespace Ui {
class DialogTypeList;
}

class LIB_UI_QT_DLL DialogTypeList : public QDialog
{
    Q_OBJECT

public:
    explicit DialogTypeList(QWidget *parent = nullptr);
    ~DialogTypeList();

    EControllerPtr getController();
    QTreeWidget* getTreeWidget();

    bool getIfCancelled();
public slots:
    void slotButtonOk(bool value);
    void slotButtonCancel(bool value);
    void slotCurrentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);


private:
    Ui::DialogTypeList *ui;
    EControllerQtTreePtr m_controllerTree;
    bool m_ifCancelled = false;
    // void addToList(const QString& str);
    // QString getSelectedTypeName();
    // QString m_selectedTypeName;
};

#endif // WIDGETTYPELIST_H
